<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <form action="add.do" method="post">
        <input type="hidden" name="id" th:value="${user.id}">
        <input type="hidden" name="flag" value="update">
        <input type="text" name="username" th:value="${user.username}">
        <input type="text" name="pwd" th:value="${user.pwd}">
        <select name="sex">
            <div th:if="${user.sex}=='boy'">
                <option selected>boy</option>
                <option>girl</option>
            </div>
            <div th:if="${user.sex}=='girl'">
                <option >boy</option>
                <option selected>girl</option>
            </div>
        </select>
    <input type="submit" value="Submit">
</form>
</body>
</html>